package com.immoc.web.listener;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import com.immoc.domain.User;

/**
 * Application Lifecycle Listener implementation class
 * InitServletContextListener
 *
 */
@WebListener
public class InitServletContextListener implements ServletContextListener {

    public InitServletContextListener() {
        // TODO Auto-generated constructor stub
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        // TODO Auto-generated method stub
    }

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("初始化........");
        List<User> userList = new ArrayList<User>();
        sce.getServletContext().setAttribute("userList", userList);
    }

}
